package com.example.springboot.utils;

import lombok.extern.slf4j.Slf4j;


/**
 * 消息队列工具
 * @author Administrator
 */
@Slf4j
public class RabbitMqUtils {

    /*@Autowired
    private ConnectionFactory connectionFactory;


    *//**
     * 创建并绑定队列到指定交换机
     * @param exchangeName
     * @param queueName
     * @param routingKey
     * @return success
     *//*
    public boolean createQueue(String exchangeName, String queueName, String routingKey) {
        boolean success = false;
        try {
            RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
            rabbitAdmin.deleteQueue(queueName);
            Binding binding = BindingBuilder.bind(new Queue(queueName))
                    .to(new DirectExchange(exchangeName, true, false))
                    .with(routingKey);
            rabbitAdmin.declareBinding(binding);
            success = true;
        } catch (Exception e) {
            e.getStackTrace();
            log.error(e.getMessage());
        } finally {
            return success;
        }
    }*/
}
